package alo.p6.work3;

import alo.p6.ThreadedBinaryTreeNode;

/**
 * @ClassName PreorderTraversal
 * @Description 中序线索二叉树的前序遍历
 * @Author Fanxc
 * @DATE 2021/2/6 11:50
 * @Version 1.0
 */
public class PreorderTraversal {
    //利用方法
    void preorderTraversal(ThreadedBinaryTreeNode root){
        ThreadedBinaryTreeNode P;
        PreorderSuccessor preorderSuccessor = new PreorderSuccessor();
        P=preorderSuccessor.preorderSuccessor(root);
        while (P!=root){
            P=preorderSuccessor.preorderSuccessor(P);
            System.out.println(P.getData());
        }
    }

}
